package com.liufuhao.crowd.api;

import java.util.concurrent.TimeUnit;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.liufuhao.crowd.util.ResultEntity;

@FeignClient("crowd-redis")
public interface RedisRemoteService {
	
	@RequestMapping("/set/redis/key/value/remote")
	ResultEntity<String> setRedisKeyValueRemote(
			@RequestParam("key") String key,
			@RequestParam("value") String value);
	
	@RequestMapping("/set/redis/key/value/remote/with/timeout")
	ResultEntity<String> setRedisKeyValueRemoteWithTimeout(
			@RequestParam("key") String key,
			@RequestParam("value") String value,
			@RequestParam("time") Long time,
			@RequestParam("timeUnit") TimeUnit timeUnit);
	
	@RequestMapping("/get/redis/string/value/by/key")
	ResultEntity<String> getRedisStringValueByKey(@RequestParam("key") String key);

	@RequestMapping("/remove/redis/key/remote")
	ResultEntity<String> removeRedisKeyRemote(@RequestParam("key") String key);


}
